package io.geekidea.springbootplus.system.service.impl;

import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.system.entity.MerchantConfig;
import io.geekidea.springbootplus.system.mapper.MerchantConfigMapper;
import io.geekidea.springbootplus.system.param.MerchantConfigStatusParam;
import io.geekidea.springbootplus.system.service.MerchantConfigService;
import io.geekidea.springbootplus.system.vo.MerchantConfigQueryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class
MerchantConfigServiceImpl extends BaseServiceImpl<MerchantConfigMapper, MerchantConfig> implements MerchantConfigService {


    @Resource
    private MerchantConfigMapper merchantConfigMapper;
    @Override
    public boolean updateStatus(MerchantConfigStatusParam merchantConfigStatusParam) {
        return merchantConfigMapper.updateStatus(merchantConfigStatusParam) >0;
    }

    @Override
    public List<MerchantConfigQueryVo> findConfig() {
        return merchantConfigMapper.selectConfig();
    }

    @Override
    public MerchantConfigQueryVo finConfigById(int id) {
        return merchantConfigMapper.selectMerchantConfigById(id);
    }

    @Override
    public boolean deleteConfig(int id) {
        return merchantConfigMapper.deleteConfig(id) >0;
    }

    @Override
    public boolean updateConfig(MerchantConfigQueryVo merchantConfigQueryVo) {
        return merchantConfigMapper.updateConfig(merchantConfigQueryVo) >0;
    }

    @Override
    public boolean addConfig(MerchantConfigQueryVo merchantConfigQueryVo) {
        return merchantConfigMapper.insertConfig(merchantConfigQueryVo) >0;
    }
}
